/** */

<template>
  <a-input
    v-decorator="[name]"
    placeholder="sssssss"
    @change="(e) => handleControlValueChange(name, e)"
  />
</template>

<script>
export default {
  name: 'myControl',
  model: {
    prop: 'value',
    event: 'change',
  },
  props: {
    name: String,
    value: String,
    // onChange: Function,
  },
  data() {
    console.log('this.onChange is:', this.onChange)
    return {}
  },
  watch: {
    value(newValue) {
      console.log('now update value:', newValue)
    },
  },
  methods: {
    handleControlValueChange(name, e) {
      console.log('[function] control.handleControlValueChange')
      const value = e.target.value
      // this.$emit('onValueChange', name, value)
      this.$emit('change', value)
    },
  },
}
</script>

<style></style>
